package com.smart.upload.bean;

/**
 * <b>Description:上传用户信息</b><br>
 * @author 唐海洋
 * @version 1.0 2016-8-5 上午10:41:25
 */
public class UserInfo{

	private String account;
	private String nikeName;
	private String basePath;

	public UserInfo(String basePath) {
		super();
		this.basePath = basePath;
	}
	
	public UserInfo(String account,String nikeName,String basePath) {
		super();
		this.account = account;
		this.nikeName = nikeName;
		this.basePath = basePath;
	}
	
	public String getAccount() {
		return account;
	}

	public String getNikeName() {
		return nikeName;
	}

	/**
	 * Description:获取用户上传根路径
	 * @author 唐海洋
	 * @Version 1.0 2016-8-5上午10:40:36 
	 * @return
	 */
	public String getBasePath() {
		//格式化basepath,保证basepath路径格式为“path/”
		if(basePath.indexOf("/")==0){
			basePath=basePath.substring(1,basePath.length());
		}
		if(basePath.lastIndexOf("/")!=basePath.length()-1){
			basePath=basePath+"/";
		}
		return basePath;
	}
}
